﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<meta name="apple-touch-fullscreen" content="yes" />
	<meta name="format-detection" content="telephone=no, email=no" />
	<link rel="stylesheet" href="styles/style.css">
	<script src="./libs/play/jessibuca.js"></script>
	<style>

	</style>
</head>

<body>
	<div class="container">
		<div id="playCanvas"></div>
	</div>
	<script type='text/javascript' src="./libs/common.js"></script>
	<script type='text/javascript'>
		//设置convas的宽高
		var canvas = document.getElementById("playCanvas");
		canvas.style.width = window.innerWidth + "px";
		canvas.style.height = window.innerHeight + "px";
		let jessibuca = new Jessibuca({
			container: canvas,
			videoBuffer: 0.2, // 缓存时长
			isResize: false,
			text: "",
			loadingText: "",
		});


		//Formated logger.
		var logger = new Logger("Page");
		function playVideo() {
			var protoObj = {
				url: getQueryString('videoUrl'),
				// url: "http://172.16.22.201:9000/live/7605662860169526_001-0104.flv",
			};
			// jessibuca.play(window.location.origin + protoObj.url);
			jessibuca.play("https://ssiot.cc" + protoObj.url);
			
		}

		function stopVideo() {
			jessibuca.pause();
		}

		function getQueryString(name) {
			let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
			let r = window.location.search.substr(1).match(reg);
			if (r != null) {
				return unescape(r[2]);
			};
			return null;
		}
		playVideo()
	</script>
</body>

</html>
